<%-- 
    Document   : editProduct
    Created on : Jun 13, 2012, 6:02:43 PM
    Author     : Owner
--%>

<%@include file="/jsp/adminTop.jsp" %>

<html>
    <head>
        <title>Edit Product</title>
    </head>
    <body>
        <div class="clear"></div>
        <table border="1" cellspacing="10px" align="center" width="100%">
            <tr>
                <td style="vertical-align: top;" width="20%">
                    <%@include file="/jsp/right.jsp" %>
                </td>
                <td>                &nbsp;            </td>
                <td style="vertical-align: top;" width="80%">
                    <div class="page-title"><h1>Manage Products</h1></div>
                    <table border="1" cellspacing="10px" align="center">
                        <tr>
                            <td><h2>Edit Product</h2></td>
                            <td>[<a href="./product.do?action=showManageProducts">List Products</a> |
                                <a href="./product.do?action=showAddProduct">Add Products</a> |
                                <a href="./product.do?action=deleteProduct">Delete</a>]
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <html:form action="/product" method="post" enctype="multipart/form-data">
                                    <logic:present name="product" scope="request">
                                        <table border="1" cellspacing="10px" align="center">
                                            <tr><td colspan="2">Product Details</td></tr>
                                            <tr>
                                                <td colspan="2">
                                                    Product Id:<strong><bean:write name="product" property="productId"/></strong>
                                                    <html:hidden name="product" property="productId"/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Product Name:</td>
                                                <td><html:text name="product" property="productName"/></td>
                                            </tr>
                                            <tr><td colspan="2"><html:errors property="errProductName"/></td></tr>
                                            <tr>
                                                <td> Title :</td>
                                                <td><html:text name="product" property="productTitle"/></td>
                                            </tr>
                                            <tr><td colspan="2"> <html:errors property="errPropertyTitle"/></td></tr>
                                            <tr>
                                                <td>Long Description:</td>
                                                <td><html:textarea name="product" property="productDescription"/></td>
                                            </tr>
                                            <tr><td colspan="2"><html:errors property="errProductDesc"/></td></tr>
                                            <tr>
                                                <td>Price:</td>
                                                <td><html:text name="product" property="productPrice"/> </td>
                                            </tr>
                                            <tr><td colspan="2"><html:errors property="errProductPrice"/></td></tr>
                                            <tr>
                                                <td>Discount:</td>
                                                <td>Discount Price:</td>
                                            </tr>
                                            <tr>
                                                <td><html:text name="product" property="productDiscount"/></td>
                                                <td><html:text property="productDiscountPrice"/></td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <div class="chkproducttaxable">
                                                        <html:checkbox name="product" property="productTaxable" onchange="javascript:togglediv('taxValue');" value="ON"/> Taxable Product
                                                    </div>
                                                </td>
                                                <td>
                                                    <div id="taxValue" style="display: none">
                                                        Tax Value: <br/><html:text value="0" name="product" property="productTaxValue"/>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr><td colspan="2"><html:errors property="errProductTaxValue"/> </td></tr>
                                            <tr>
                                                <td>Items in Stock:</td>
                                                <td><html:text name="product" property="productQty"/></td>
                                            </tr>
                                            <tr><td colspan="2"><html:errors property="errProductQty"/> </td></tr>
                                            <tr>
                                                <td>Small Image:</td>
                                                <td><html:file name="product" property="productSmallImage" accept="image/*" />
                                                    <br/>
                                                    <html:hidden name="product" property="productSmallImageName"/>
                                                    <img src="products/<bean:write name="product" property="productSmallImageName"/>" alt="Product Small Image"
                                                         style="width: 110px; height: 110px;border: 1px solid black;"/></td>
                                            </tr>
                                            <tr>
                                                <td colspan="2"><html:errors property="errProductSmallImage"/></td>
                                            </tr>
                                            <tr>
                                                <td>Large Image:</td>
                                                <td><html:file name="product" property="productLargeImage" accept="image/*" />
                                                    <br/>
                                                    <html:hidden name="product" property="productLargeImageName"/>
                                                    <img src="products/<bean:write name="product" property="productLargeImageName"/>" alt="Product Large Image"
                                                         style="width: 350px; height: 250px;border: 1px solid black;"/></td>
                                            </tr>
                                            <tr>
                                                <td colspan="2"><html:errors property="errProductLargeImage"/></td>
                                            </tr>
                                            <tr>
                                                <td>Brand:</td>
                                                <td><html:select name="product" property="productBrandId">
                                                        <html:option value="0">--Brands--</html:option>
                                                        <html:options collection="brandList" property="key" labelProperty="value"/>
                                                    </html:select>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2"> <html:errors property="errProductBrand"/></td>
                                            </tr>
                                            <tr>
                                                <td>Parent Category</td>
                                                <td><html:select name="product" property="productCategoryId">
                                                        <html:option value="0">--Select--</html:option>
                                                        <html:options collection="parentCategList" property="key" labelProperty="value"/>
                                                    </html:select>  </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2"><html:errors property="errProductCategory"/></td>
                                            </tr>
                                            <tr>
                                                <td>Status:</td>
                                                <td><html:select name="product" property="productStatusId">
                                                        <html:option value="0">--Status--</html:option>
                                                        <html:options collection="statusList" property="key" labelProperty="value"/>
                                                    </html:select></td>
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                                    <div id="errdividproduct" >
                                                        <span id="errspanidproduct"></span>
                                                        <html:errors property="errProduct"/>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td><a onclick="javascript:return validateProduct('./product.do?action=updateProduct','ProductBean')">
                                                        <img src="images/update.png" onmouseout="src='images/update.png'" onmouseover="src='images/update-hover.png'" alt="Save Product" /></a></td>
                                                <td><a onclick="javascript:deleteProduct('./product.do?action=deleteProduct','ProductBean')">
                                                        <img src="images/delete.png" onmouseout="src='images/delete.png'" onmouseover="src='images/delete-hover.png'" alt="Delete Product" /></a></td>
                                            </tr>
                                        </table>
                                    </logic:present>
                                </html:form>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>

    </body>
</html>
